/***

LZRoster: A roster for World of Warcraft.
Copyright (C) 2007  Emmanuel Cron

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

***/

function toggle(start, nb) {
	var img = document.getElementById('plus_minus_img_' + start);
	
	for (var i=start ; i<parseInt(start,10)+parseInt(nb,10) ; i++)
	{
		var tr = document.getElementById('toggable_line_' + i);
		var t_img = tr.getElementsByTagName('img');
		
		if (tr.style.display == 'none')
		{
			tr.style.display='';
			
			for (var j=0 ; j<t_img.length ; j++)
			{
				if (t_img[j].title != "")
				{
					t_img[j].src=t_img[j].title;
					t_img[j].title='';
				}
			}
			
			if (i == start)
			{
				img.src = 'Interface/Buttons/UI-MinusButton-Up.gif';
			}
		}
		else
		{
			tr.style.display='none';
			
			if (i == start)
			{
				img.src = 'Interface/Buttons/UI-PlusButton-Up.gif';
			}
		}
	}
}

function more_less(id)
{
	var more = document.getElementById(id + "_more");
	var less = document.getElementById(id + "_less");
	var chars = document.getElementById(id + "_chars");
	
	if ( more.style.display == "" )
	{
		more.style.display = "none";
		less.style.display = "";
		chars.style.display = "";
	}
	else
	{
		more.style.display = "";
		less.style.display = "none";
		chars.style.display = "none";
	}
}